import request from '@/utils/request.js'

// 2222
export function getImg() {
  return request({
    url: '/home/swiper'
  })
}

export function getRent() {
  return request({
    url: '/home/groups'
  })
}

export function getHouses() {
  return request({
    url: '/houses'
  })
}

export function getCity(level) {
  return request({
    url: '/area/city',
    params: {
      level: level
    }
  })
}

// 获取热门城市
export function hotCity() {
  return request({
    url: '/area/hot'
  })
}

// 发布房屋

export function getrelease() {
  return request({
    url: '/houses/params'
  })
}

// 图片上传
export function gethousesImg(data) {
  return request({
    url: '/houses/image',
    method: 'POST',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data
  })
}

// 发布房源
export function gethouses(data) {
  return request({
    url: '/user/houses',
    method: 'POST',
    data: data
  })
}

export function getcondition(id) {
  return request({
    url: '/houses/condition',
    params: {
      id
    }
  })
}

export function gethousesid(id) {
  return request({
    url: '/houses/' + id
  })
}
